package org.idea.spring.framework.event.multiEvent.listener;

import lombok.SneakyThrows;
import org.idea.spring.framework.event.multiEvent.events.MyAsyncEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author linhao
 * @Date created in 3:22 下午 2021/5/30
 */
@Component
public class Listener3 implements ApplicationListener<MyAsyncEvent> {

    @SneakyThrows
    @Override
    public void onApplicationEvent(MyAsyncEvent event) {
        System.out.println("3---" + event.getSource() + "thread is " + Thread.currentThread().getName());
        Thread.sleep(1000);
        System.out.println("end 3");
    }
}
